﻿namespace EFS.RC.CC.Deployment.Entities
{
	/// <summary>
	/// Operator
	/// </summary>
	public abstract class Operator : EFS.Common.ISelfDescriptor, EFS.Common.Serialization.ISerializable
	{
		public System.Int32? ID { get; set; }
		public System.Int32? OfficeEndPointID { get; set; }
		public System.Guid? DomainOid { get; set; }
		public System.String DomainLogonName { get; set; }

		/// Describe
		public virtual System.String Describe()
		{
			return System.String.Format("EFS.RC.CC.Deployment.Entities.Operator {0} {1}", DomainOid, DomainLogonName);
		}

		/// Serialize
		public void Serialize(EFS.Common.Serialization.XmlWriter xmlWriter)
		{
			// write
			xmlWriter.Write("ID", ID);
			xmlWriter.Write("OfficeEndPointID", OfficeEndPointID);
			xmlWriter.Write("DomainOid", DomainOid);
			xmlWriter.Write("DomainLogonName", DomainLogonName);
		}

		/// Deserialize
		public void Deserialize(EFS.Common.Serialization.XmlReader xmlReader)
		{
			// read
			ID = xmlReader.ReadInt32("ID");
			OfficeEndPointID = xmlReader.ReadInt32("OfficeEndPointID");
			DomainOid = xmlReader.ReadGuid("DomainOid");
			DomainLogonName = xmlReader.Read("DomainLogonName");
		}
	}
}